package com.huahua.api.exception;

import com.huahua.api.enums.ErrorEnum;
import lombok.Data;

/**
 * @author LoveHuahua
 * @date 2021年09月16日 11:59
 * @description believe in yourself
 */
@Data
public class CommonException extends RuntimeException{
    private int code;

    private String message;


    public CommonException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public CommonException(ErrorEnum errorEnum) {
        this.code = errorEnum.getCode();
        this.message = errorEnum.getMessage();
    }

}
